<style>
    #secend{display: none;overflow: hidden}
    #secend .content{min-height: 110px }
    .choose-time{display: none;padding: 12px;}

    .re-time input[type='text']{width: 135px;height: 35px}
    .re-time select{height: 35px;width: 80px;margin-right: 5px;}
    .callPhone{position: relative}
    .callPhone .call-type{display: none;position: absolute;width: 320px;height: 30px;padding: 10px;left:-150px;top:16px;background: #fff;z-index:99}


    .callPhone:hover .call-type{display: block}
    .layui-layer-page .layui-layer-content{padding: 20px;}

</style>
<section class="content">
    <div class="search">
        <form role="form">
            <div class="row">
                <div class="col-xs-3 col-md-4">
                    <div class="form-group">
                        <div class="date-box">
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input type="text" ng-model="callModel.begintime"
                                       class="form-control pull-right date-picker timerange" placeholder="开始时间" >
                                <span class="line">-</span>
                                <input type="text" ng-model="callModel.endtime"
                                       class="form-control pull-right date-picker timerange" placeholder="结束时间"  >
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xs-1 col-md-2">
                    <div class="form-group" >
                        <input type="text" class="form-control" placeholder="用户姓名" ng-model="callModel.userName">
                    </div>
                </div>
                <div class="col-xs-1 col-md-2">
                    <div class="form-group">
                        <select name="" id="" class="form-control" ng-model="callModel.status">
                            <option value="">全部</option>
                            <option value="1">预约中</option>
                            <option value="3">已完成</option>
                            <option value="2">已预约</option>
                            <option value="5">已取消</option>
                        </select>
                    </div>
                </div>
                <div class="col-xs-1">
                    <input type="button" class="btn-primary btn" value="查询" ng-click="queryCommentList(1)">
                </div>
                <div class="col-xs-1">
                    <input type="reset" class="btn-primary btn" value="重置" ng-click="reset()">
                </div>
                <div class="col-xs-1">
                    <input type="button" class="btn-default btn" value="导出" ng-click="exportExcel()">
                </div>

            </div>
        </form>
    </div>
    <div class="table-box">
        <table class="table table-bordered">
            <thead>
            <tr>
                <th>订单号</th>
                <th>下单时间</th>
                <th>姓名</th>
                <th>电话</th>
                <th>预约专家</th>
                <th>当前预约状态</th>
                <th>预约通话时间</th>
                <th>累计通话时长</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat=" n in callList">
                <td>{{n.orderNo}}</td>
                <td>{{n.orderTime | date:"yyyy-MM-dd HH:mm:ss"}}</td>
                <td>{{n.userName}}</td>
                <td>{{n.userMobile}}</td>
                <td>{{n.doctorName}}</td>
                <td>
                    <span ng-if="n.serviceStatus=='0'">待付款</span>
                    <span ng-if="n.serviceStatus=='1'">预约中</span>
                    <span ng-if="n.serviceStatus=='2'">已预约</span>
                    <span ng-if="n.serviceStatus=='3'">已完成</span>
                    <span ng-if="n.serviceStatus=='5'">已取消</span>
                </td>
                <td>{{n.consultationTime | date:"yyyy-MM-dd HH:mm:ss"}}</td>
                <td>{{ (n.talkTime) ? n.talkTime : 0 }}秒</td>

                <td>
                   <span ng-if="n.serviceStatus=='5' || n.serviceStatus=='3'" >
                       <span>描述预览</span> |
                       <a   href="javascript:;"  data-detail="{{n}}" class="callPhone">通话<span class="caret"></span>
                           <div class="call-type">
                              <button class="btn btn-primary btn-sm" ng-click="callUser($event)">拨打用户</button>
                              <button class="btn btn-primary btn-sm" ng-click="callDoctor($event)">拨打医生</button>
                              <button class="btn btn-primary btn-sm" ng-click="callDouble($event)">双向通话</button>
                               <button class="btn btn-primary btn-sm" ng-click="conversationList($event)" data-orderNo="{{n.orderNo}}">通话记录</button>
                           </div>
                        </a>  |  <a href="javascript:;" ng-click="conversationList($event)" data-orderNo="{{n.orderNo}}">通话记录</a> | <span>预约</span>
                   </span>
                    <span ng-if="n.serviceStatus=='1'">
                         <a  ui-sref="appointment/situation_description({orderId:{{n.wXOrderId}}})">描述预览</a> |
                          <a   href="javascript:;"  data-detail="{{n}}" class="callPhone">通话<span class="caret"></span>
                           <div class="call-type">
                              <button class="btn btn-primary btn-sm" ng-click="callUser($event)">拨打用户</button>
                              <button class="btn btn-primary btn-sm" ng-click="callDoctor($event)">拨打医生</button>
                              <button class="btn btn-primary btn-sm" ng-click="callDouble($event)">双向通话</button>
                               <button class="btn btn-primary btn-sm" ng-click="conversationList($event)" data-orderNo="{{n.orderNo}}">通话记录</button>
                           </div>
                        </a> |
                        <a  href="javascript:;" ng-click="reconversation($event)" data-orderNo="{{n.orderNo}}" data-mobileServiceId="{{n.mobileServiceId}}" data-wxOpenId="{{n.wxOpenId}}" data-toggle="modal" data-orderTime='{{n.consultationTime}}' data-target="#myModal">预约</a>
                    </span>
                    <span ng-if="n.serviceStatus=='2'">
                          <span>描述预览</span> | <a   href="javascript:;"  data-detail="{{n}}" class="callPhone">通话<span class="caret"></span>
                           <div class="call-type">
                              <button class="btn btn-primary btn-sm" ng-click="callUser($event)">拨打用户</button>
                              <button class="btn btn-primary btn-sm" ng-click="callDoctor($event)">拨打医生</button>
                              <button class="btn btn-primary btn-sm" ng-click="callDouble($event)">双向通话</button>
                               <button class="btn btn-primary btn-sm" ng-click="conversationList($event)" data-orderNo="{{n.orderNo}}">通话记录</button>
                           </div>
                        </a>  |

                        <a  href="javascript:;" ng-click="reconversation($event)" data-orderNo="{{n.orderNo}}" data-mobileServiceId="{{n.mobileServiceId}}" data-wxOpenId="{{n.wxOpenId}}" data-toggle="modal" data-orderTime='{{n.consultationTime}}' data-target="#myModal">预约</a>
                    </span>
                </td>

            </tr>
            <tr>
                <td colspan="9" ng-if="callList.length<=0" class="text-center">暂时无数据！</td>
            </tr>
            </tbody>
        </table>
        <div class="page-function text-center" ng-if="callList.length > 0"></div>
    </div>

    <!--拨打医生-->
    <div id="secend" class="dialog">
        <div class="content">
            <p class="doctor-name">与任正非联系</p>
            <p class="doctor-tel">联系电话18780214384</p>
            <p>
                <button class="btn btn-default" ng-click="cancelCall()">取消拨打</button>
                <button class="btn btn-primary" ng-click="Call($event)">确认拨打</button>
            </p>
        </div>
        <div class="choose-time">
                <p>确定预约时间：</p>
                <input type="text"class="date-picker timerange" name="doctorTime" value="{{minDate}}">
                <select name="hour" class="doctor-hour">
                    <option value="08">08</option>
                    <option value="09">09</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="21">21</option>
                    <option value="21">21</option>
                    <option value="22">22</option>
                </select> 时
                <select name="sec" class="doctor-sec">
                    <option value="00">00</option>
                    <option value="10">10</option>
                    <option value="20">20</option>
                    <option value="30">30</option>
                    <option value="40">40</option>
                    <option value="50">50</option>
                </select> 分
                <p style="margin-top: 10px">
                    <input class="btn btn-default" type="reset" value="更改">
                    <button class="btn btn-primary" ng-click="save()">保存</button>
                </p>
        </div>
    </div>

    <!--重新预约-->

    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">预约</h4>
                </div>
                <div class="modal-body re-time">
                    <div class="row">
                       <div class="col-xs-5">确定时间：</div>
                    </div>
                    <div class="row">
                        <div class="col-xs-4"><input type="text" class="date-picker" name="date" value="{{orderTime}}"></div>
                        <div class="col-xs-3">
                            <select name="hour" class="hour">
                            <option value="08">08</option>
                            <option value="09">09</option>
                            <option value="10">10</option>
                            <option value="11">11</option>
                            <option value="12">12</option>
                            <option value="13">13</option>
                            <option value="14">14</option>
                            <option value="15">15</option>
                            <option value="16">16</option>
                            <option value="17">17</option>
                            <option value="18">18</option>
                            <option value="19">19</option>
                            <option value="20">20</option>
                            <option value="21">21</option>
                            <option value="21">21</option>
                            <option value="22">22</option>
                        </select>时
                        </div>
                        <div class="col-xs-3">
                            <select name="sec" class="sec">
                            <option value="00">00</option>
                            <option value="10">10</option>
                            <option value="20">20</option>
                            <option value="30">30</option>
                            <option value="40">40</option>
                            <option value="50">50</option>
                        </select>分</div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" ng-click="commitReTime()">确定</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>


</section>